// Alpha Filter Class
// AlphaFilter.java

// Imports
import java.awt.image.*;

class AlphaFilter extends RGBImageFilter {
  int alphaLevel;

  public AlphaFilter(int alpha) {
    alphaLevel = alpha;
    canFilterIndexColorModel = true;
  }

  public int filterRGB(int x, int y, int rgb) {
    // Adjust the alpha value
    
	  return ((rgb & 0x00ffffff) | (alphaLevel << 24));
  }
}
